package com.maybach.core.manager.impl;

import com.maybach.common.model.ActLogDO;
import com.maybach.common.query.ActLogQuery;
import com.maybach.core.dal.mapper.ext.ActLogExtMapper;
import com.maybach.core.manager.ActLogManager;
import com.maybach.util.query.support.PageResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for ActLog.
 */

@Component
public class ActLogManagerImpl implements ActLogManager{
    protected Logger log = LoggerFactory.getLogger(this.getClass());

    
    @Autowired
    protected ActLogExtMapper actLogExtMapper;
    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(ActLogQuery query){
        return actLogExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(ActLogQuery query){
        return actLogExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(ActLogDO record){
        return actLogExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(ActLogDO record){
        return actLogExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<ActLogDO> selectByQuery(ActLogQuery query){
        return actLogExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
    */
    @Override
    public PageResult<ActLogDO> selectByQueryWithPage(ActLogQuery query) {
        PageResult<ActLogDO> result = new PageResult<ActLogDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public ActLogDO selectByPrimaryKey(Long id){
        return actLogExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective( ActLogDO record,  ActLogQuery query){
        return actLogExtMapper.updateByQuerySelective(record,  query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery( ActLogDO record,  ActLogQuery query){

        return actLogExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(ActLogDO record){
        return actLogExtMapper.updateByPrimaryKeySelective(record);
    }
}